import { Component, OnInit, ViewChild } from '@angular/core';
import { ColumnType, SPage, TablePageComponent } from '@shared/components/table-page/table-page.component';
import { Body, _HttpClient } from '@delon/theme';
import { NzMessageService, NzModalService ,NzModalRef } from 'ng-zorro-antd';
import { STData } from '@delon/abc';

@Component({
  selector: 'room-list',
  templateUrl: './room-list.component.html',
  styles: ['>>>.width80{width:80%;}']
})
export class RoomListComponent implements OnInit {
  @ViewChild('st', { static: false }) st: TablePageComponent;
  
  loading = false;
  selectData: any[];
  // {
  //   id: '',
  //   areaParentAllName:''
  // };
  config: SPage = {
    columns: [
      {
        index:"",
        title:"选择",
        type:ColumnType.checkbox
      },
      {
        index: 'areaParentAllName',
        title: '区域名称',
        filter: {
          placeholder: '请输入房屋名称',
          type: 'string'
        },
        className:'width80'
      }
    ],
    showCheckBox: false,
    reqUrl:'/core/city/area/findAreaAndBinding',
    // editBtn: [
    //   { title: '选择' }
    // ]
  }
  constructor(private http: _HttpClient, private modal: NzModalService,private ref: NzModalRef, private message: NzMessageService) { }
  
  ngOnInit() {

  }
  _console(e: any): void {
    this.selectData = e;
    console.log(e);
  }
  operate(e: any): void {
    // if (e.title === '选择') {
    //   console.log(e.data)
    //   // this.selectData.id = e.data.id;
    //   // this.selectData.areaParentAllName = e.data.areaParentAllName;
    //   this.ref.triggerOk();
    // }
  }

  dataProcess(data: STData[]){
    console.log(data);
    return data;
  }
  

}
